package com.lz.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**@设备装潢类
 * @author:周浩宇
 * @aate:2018/10/21 14:02
 * */

@Data
@Table
@Entity

public class EquipmentSheet implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6603916545755494871L;
	@Id
	@GeneratedValue(generator = "native")
	@GenericGenerator(name = "native",strategy = "native")
	/**设备单编号*/
	private Integer equipmentSheetNo;
	/**开具日期*/
	@DateTimeFormat(pattern = "yyyy-MM-dd" )
	private Date openingTime;

	/**装潢开始时间*/
	@DateTimeFormat(pattern = "yyyy-MM-dd" )
	private Date startTime;
	/**装潢截止时间*/
	@DateTimeFormat(pattern = "yyyy-MM-dd" )
	private Date endingTime;
	/**装潢单状态*/
	private String equipmentSheetState;
	/**总金额*/
	private Double totalPrice;
	/**赠送金额*/
	private Double givenMoney;
	/**应收金额*/
	private Double receivables;
	/**已收金额*/
	private Double received;
	/**备注*/
	private String comment;
	/**对应开单员工*/
	@OneToOne(targetEntity=Employee.class,fetch =FetchType.EAGER )
	@JoinColumn(name="employeeId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Employee employee;
	/**对应客户*/
	/**对应装潢员工*/
	@OneToOne(targetEntity=InstallationPerson.class,fetch =FetchType.EAGER)
	@JoinColumn(name="personNO")
	@NotFound(action=NotFoundAction.IGNORE)
	private InstallationPerson nstallationPerson;
	/**对应客户*/

	@OneToOne(targetEntity=Customer.class,fetch =FetchType.EAGER)
	@JoinColumn(name="customerId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Customer customer;
	/**对应车辆*/
	@OneToOne(targetEntity=Car.class,fetch =FetchType.EAGER)
	@JoinColumn(name="carId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Car car;
	/**装潢业务*/
	@OneToOne(targetEntity=UpholsteryType.class,fetch =FetchType.EAGER)
	@JoinColumn(name="upholsteryType")
	@NotFound(action=NotFoundAction.IGNORE)
	private UpholsteryType upholsteryType;


	
}
